package com.gxa.modules.service.impl;

import com.gxa.common.vo.JsonResult;
import com.gxa.modules.mapper.StageMemberMapper;
import com.gxa.modules.service.StageMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class StageMemberServiceImpl implements StageMemberService {
    @Autowired(required = false)
    private StageMemberMapper stageMemberMapper;
    @Override
    public JsonResult findMemberByName(Integer page, Integer pageSize, String sh_name){
        JsonResult r =new JsonResult();
        Integer parma1=(page-1)*pageSize;
        Integer parma2=pageSize;
        List<Map> memberList = stageMemberMapper.findMemberByName(parma1,parma2,sh_name);
        Integer count=stageMemberMapper.findCount(sh_name);
        r.setCode(200);
        r.setMsg("查询成功");
        r.setCount(count);
        r.setData(memberList);
        return r;
    }

    @Override
    public JsonResult findAccountByName(Integer page, Integer pageSize, String sh_name) {
        JsonResult r =new JsonResult();
        Integer parma1=(page-1)*pageSize;
        Integer parma2=pageSize;
        Integer count=stageMemberMapper.findAccountCount(sh_name);
        List<Map> accountList = stageMemberMapper.findAccountByName(parma1,parma2,sh_name);
        r.setCode(200);
        r.setMsg("查询成功");
        r.setCount(count);
        r.setData(accountList);
        return r;
    }
}
